package com.cjhhv.visual.controller;


import cn.hutool.core.util.ArrayUtil;
import com.cjhhv.base.model.ResponseDataModel;
import com.cjhhv.base.util.ResponseDataUtil;
import com.cjhhv.visual.model.DashboardLogModel;
import com.cjhhv.visual.model.DashboardModel;
import com.cjhhv.visual.service.DashboardLogService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/dashboardLog")
public class DashboardLogController {

    private DashboardLogService dashboardLogService;


    @PostMapping("/queryDashboardLogListByParameter")
    @ResponseBody
    public ResponseDataModel queryDashboardLogListByParameter(@RequestBody DashboardLogModel parameter){
        List<DashboardLogModel> list = this.dashboardLogService.queryDashboardLogListByParameter(parameter);
        if(ArrayUtil.isEmpty(list)){
            return ResponseDataUtil.createResponseData(false,"查询失败!",null);
        }
        return ResponseDataUtil.createResponseData(true,"查询成功!",list);
    }

    public DashboardLogService getDashboardLogService() {
        return dashboardLogService;
    }

    @Autowired
    public void setDashboardLogService(DashboardLogService dashboardLogService) {
        this.dashboardLogService = dashboardLogService;
    }
}
